/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.gameshop.gui;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author MarcioMorando
 */
@Entity
@Table(name = "e004cadjogo", catalog = "mydb", schema = "")
@NamedQueries({
    @NamedQuery(name = "E004cadjogo.findAll", query = "SELECT e FROM E004cadjogo e"),
    @NamedQuery(name = "E004cadjogo.findByIdJogo", query = "SELECT e FROM E004cadjogo e WHERE e.idJogo = :idJogo"),
    @NamedQuery(name = "E004cadjogo.findByNome", query = "SELECT e FROM E004cadjogo e WHERE e.nome = :nome"),
    @NamedQuery(name = "E004cadjogo.findByPrecovenda", query = "SELECT e FROM E004cadjogo e WHERE e.precovenda = :precovenda"),
    @NamedQuery(name = "E004cadjogo.findByPrecoaluguel", query = "SELECT e FROM E004cadjogo e WHERE e.precoaluguel = :precoaluguel"),
    @NamedQuery(name = "E004cadjogo.findByCategoria", query = "SELECT e FROM E004cadjogo e WHERE e.categoria = :categoria"),
    @NamedQuery(name = "E004cadjogo.findByFaixaetaria", query = "SELECT e FROM E004cadjogo e WHERE e.faixaetaria = :faixaetaria"),
    @NamedQuery(name = "E004cadjogo.findByQtdestoque", query = "SELECT e FROM E004cadjogo e WHERE e.qtdestoque = :qtdestoque"),
    @NamedQuery(name = "E004cadjogo.findByQtdalugada", query = "SELECT e FROM E004cadjogo e WHERE e.qtdalugada = :qtdalugada")})
public class E004cadjogo implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Jogo")
    private Integer idJogo;
    @Column(name = "nome")
    private String nome;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "precovenda")
    private Double precovenda;
    @Column(name = "precoaluguel")
    private Double precoaluguel;
    @Column(name = "categoria")
    private String categoria;
    @Column(name = "faixaetaria")
    private String faixaetaria;
    @Column(name = "qtdestoque")
    private Integer qtdestoque;
    @Column(name = "qtdalugada")
    private Integer qtdalugada;

    public E004cadjogo() {
    }

    public E004cadjogo(Integer idJogo) {
        this.idJogo = idJogo;
    }

    public Integer getIdJogo() {
        return idJogo;
    }

    public void setIdJogo(Integer idJogo) {
        Integer oldIdJogo = this.idJogo;
        this.idJogo = idJogo;
        changeSupport.firePropertyChange("idJogo", oldIdJogo, idJogo);
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        String oldNome = this.nome;
        this.nome = nome;
        changeSupport.firePropertyChange("nome", oldNome, nome);
    }

    public Double getPrecovenda() {
        return precovenda;
    }

    public void setPrecovenda(Double precovenda) {
        Double oldPrecovenda = this.precovenda;
        this.precovenda = precovenda;
        changeSupport.firePropertyChange("precovenda", oldPrecovenda, precovenda);
    }

    public Double getPrecoaluguel() {
        return precoaluguel;
    }

    public void setPrecoaluguel(Double precoaluguel) {
        Double oldPrecoaluguel = this.precoaluguel;
        this.precoaluguel = precoaluguel;
        changeSupport.firePropertyChange("precoaluguel", oldPrecoaluguel, precoaluguel);
    }

    public String getCategoria() {
        return categoria;
    }

    public void setCategoria(String categoria) {
        String oldCategoria = this.categoria;
        this.categoria = categoria;
        changeSupport.firePropertyChange("categoria", oldCategoria, categoria);
    }

    public String getFaixaetaria() {
        return faixaetaria;
    }

    public void setFaixaetaria(String faixaetaria) {
        String oldFaixaetaria = this.faixaetaria;
        this.faixaetaria = faixaetaria;
        changeSupport.firePropertyChange("faixaetaria", oldFaixaetaria, faixaetaria);
    }

    public Integer getQtdestoque() {
        return qtdestoque;
    }

    public void setQtdestoque(Integer qtdestoque) {
        Integer oldQtdestoque = this.qtdestoque;
        this.qtdestoque = qtdestoque;
        changeSupport.firePropertyChange("qtdestoque", oldQtdestoque, qtdestoque);
    }

    public Integer getQtdalugada() {
        return qtdalugada;
    }

    public void setQtdalugada(Integer qtdalugada) {
        Integer oldQtdalugada = this.qtdalugada;
        this.qtdalugada = qtdalugada;
        changeSupport.firePropertyChange("qtdalugada", oldQtdalugada, qtdalugada);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idJogo != null ? idJogo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof E004cadjogo)) {
            return false;
        }
        E004cadjogo other = (E004cadjogo) object;
        if ((this.idJogo == null && other.idJogo != null) || (this.idJogo != null && !this.idJogo.equals(other.idJogo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.gameshop.gui.E004cadjogo[ idJogo=" + idJogo + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
